package com.chookss.mine.set

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.chookss.R
import com.johnrambo.ktea.ktExtends.onclick
import com.lvgroup.hospital.base.BaseAct
import kotlinx.android.synthetic.main.activity_nickname.*
import kotlinx.android.synthetic.main.common_title.*


class NickNameActivity : BaseAct() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_nickname)
    }

    override fun initData() {
        initState()
        common_title_back onclick { finish() }

        val stringExtra = intent.getStringExtra("nick")
        edNickName.setText(stringExtra)
        common_right_txt.text="确定"
        common_right_txt.visibility= View.VISIBLE
        common_title_txt.text="昵称"
        common_right_txt onclick {
            val intent = Intent()
            // 设置返回码和返回携带的数据
            intent.putExtra("newNickName", edNickName.text.toString())
            setResult(1, intent)
            finish()
        }
    }


}